#include <iostream>
using namespace std;
int main()
{
    int i, n, k = 0;
    int a[100], t[100];
    cout << "please input numbers:";
    for (i = 0; i < 100; i++)
    {
        cin >> a[i];
        k++;
        if (a[i] == 0)
            break;
    }
    // 输入 0 终止输入
    for (i = 0, t[i] = 0; i < k; i++)
    {
        if (a[i] == 1) // 提前对1 进行判断
            cout << 0;
        else
        {
            while (a[i] != 1)
            {
                if (a[i] % 2 == 0)
                {
                    a[i] = a[i] / 2;
                }
                else
                {
                    a[i] = (a[i] * 3 + 1) / 2;
                }
                t[i]++;
            }
            cout << t[i] << endl;
        }
    }
    return 0;
}